package com.matt.controller.web;

import com.matt.commons.model.StatusResponse;
import com.matt.commons.page.PagerQuery;
import com.matt.foundation.constant.PermissionConstant;
import com.matt.foundation.constant.RequestConstant;
import com.matt.service.remoteCall.SsoCallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping(value = "/web/doctor")
@Api(tags = "儿保医生")
public class WebDoctorController {

    @Autowired
    private SsoCallService ssoCallService;

    @ApiOperation(value = "查询当前园区的所有儿保医生（需权限：teach::classes::doctor_list)",httpMethod = "POST")
    @PostMapping("/all_by_area")
    public StatusResponse allByArea(@RequestHeader(RequestConstant.TICKET) String ticket, PagerQuery pagerQuery) {
        if (pagerQuery!=null) {
            pagerQuery.setPageSize(100);
        }
//        return StatusResponse.success(ssoCallService.getAreaStaffList(ticket, null, PermissionConstant.TEACH_CLASSES_DOCTOR, pagerQuery));

        return StatusResponse.success(ssoCallService.getAreaStaffListByPermission(ticket,PermissionConstant.TEACH_CLASSES_DOCTOR, pagerQuery));
    }
}
